   Help for MSlot

Properties	Events

Registration Information

Order Form

Getting Custom Controls Written

Description

The Mailslot control provides simple interprocess communication between programs running on the same or different computers running Windows for Workgroups.

This control enables you to create and use Windows for Workgroups mailslots.  A mailslot is an application-defined buffer that receives and holds messages.  Applications create mailslots so that they can receive text or data from other applications on one or more computers in a network.

File Name

MSLOT1.VBX

Object Type

VBMailslots

Compatibility

VB 2.0 and above

Distribution Note     When you develop and distribute an application that uses MSlot, you should install the file MSLOT1.VBX into the users Windows SYSTEM directory.  MSlot has version information built into it.  So, during installation, you should ensure that you are not overwriting a newer version of MSlot.

Usage Note     There is a bug in the mailslot code under Windows for Workgroups.  Messages are sent twice.  The extra message is consistant.  Microsoft Knowledge Base article number Q113223 documents this bug.  Our recommendation is to read from the mailslot twice.  For an example of how to do this, please see our sample code.


Properties
MSlot Properties

Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

*Action Property (default)

Align Property

*ComputerName Property

Enabled Property

*Interval Property

Left Property

*MailslotName Property

*MailslotSize Property

*Message Property

*MessageSize Property

Name Property

*NextPriority Property

*NextSize Property

Parent Property

*Priority Property

Tag Property

*Timeout Property

Top Property

*UserName Property

*WorkgroupName Property


Events
MSlot Events

Events that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

*MessageWaiting Event (default)


Action Property

See Also

Description

Specifies the type of mailslot function to execute.

Usage

[form.][control.]Action[ = integer ]

Remarks

The action property settings are:

Value	Description

0	No Action

1	Create - Create a mailslot

2	Delete - Delete a mailslot

3	Write - Write to a mailslot

4	Read - Read from a mailslot

5	Peek - Determine a mailslots status

This property is not available at design time.

Data Type

Integer (enumerated)


Create Action

Creates a new mailslot on the local computer.

Before executing the Create action, you must first set the MailslotName, MailslotSize, and MessageSize properties.


Delete Action

Deletes a mailslot specified by MailslotName.  An error occurs if the mailslot has not been created.


Write Action

Writes a message to the mailslot specified by MailslotName.  Before invoking the Write action, you must first set the MailslotName and Message properties.


Read Action

Reads a message from the mailslot specified by MailslotName.  Before invoking the Read action, you must first create the mailslot.


Peek Action

Checks to see if there are any messages waiting for themailslot specified by MailslotName. Before invoking the Read action, you must first create the mailslot.


See Also

Properties:

Interval

MailslotName

Message

Timeout

Events:

MessageWaiting


ComputerName Property

See Also

Description

Returns the name of the computer.

Usage

[form.][control.]ComputerName[ = computername ]

Remarks

This property holds the name of the computer (node name).  This property is read-only.

Data Type

String


See Also

Properties:

UserName

WorkgroupName


Interval Property

See Also

Description

Determines how often the mailslot is polled.

Usage

[form.][control.]Interval[ = milliseconds ]

Remarks

This property determines how often, in milliseconds, the mailslot is polled.  If there are messages waiting in the mailslot when the polling occurs, the MessageWaiting event is fired.

If this property is set to zero, the event will not fire.

Data Type

Integer


See Also

Properties:

Action

Events:

MessageWaiting


MailslotName Property

See Also

Description

Specifies the name of the mailslot.

Usage

[form.][control.]MailslotName[ = string ]

Remarks

This specifies the name of the mailslot managed by this control.  The mailslot name can have one of the following formats:

Value	Description

\mailslot\mailslotname	This format represents a mailslot name mailslot name on the local computer.

\\computername\mailslot\mailslotname	This format represents a mailslot named mailslotname on the computer specified by computername.

\\workgroupname\mailslot\mailslotname	This format represents a mailslot named mailslotname on all computers in the workgroup specified by workgroupname.  If workgroupname is an asterisk (*), this format represents a mailslot on all computers in the workgroup of the local computer.

Data Type

String


See Also

Properties:

Action

MailslotSize


MailslotSize Property

See Also

Description

Specifies the maximum number of bytes available in the mailslots buffer.

Usage

[form.][control.]MailslotSize[ = integer ]

Remarks

This property specifies the size, in bytes, of the mailslot.  This parameter must be zero, or it must be equal to of exceed the size of the MessageSize property.  If this value is zero, the Create Action sets a value based on MessageSize.

Data Type

Integer


See Also

Properties:

Action

MailslotName


Message Property

See Also

Description

Buffer in which data in is transferred.

Usage

[form.][control.]Message[ = string ]

Remarks

This property contains the most recently read message after invoking the Read Action.

It is also the buffer where information should be written prior to invoking the Write Action.

Data Type

String


See Also

Properties:

Action

MailslotName

MailslotSize

MessageSize

Priority


MessageSize Property

See Also

Description

Specifies the maximum size that can be written to a mailslot.

Usage

[form.][control.]MessageSize[ = integer ]

Remarks

This property is only used when the mailslot is created (see the Create Action).

Windows for Workgroups places a limit of 400 bytes on the message size.

Data Type

Integer (1-400)


See Also

Properties:

Action

MailslotSize

Message


NextPriority Property

See Also

Description

Gives the priority of the next message, if any, in the mailslot.

Usage

[form.][control.]NextPriority

Remarks

Contains the priority (0 through 9) of the next message in the mailslot.  This propertys value is only valid if the NextSize property is greater than zero.

This property is updated each time a Read or Peek Action is invoked.  This property is read-only and available at run-time only.

Data Type

Integer (0-9)


See Also

Properties:

Action

MailslotSize

NextSize


NextSize Property

See Also

Description

Specifies the size of the next message, if any, in the mailslot.

Usage

[form.][control.]NextSize

Remarks

This property contains the size, in bytes, of the next message in the mailslot.  If the mailslot does not contain another message, the NextSize property is set to zero.

This property is updated each time a Read or Peek Action is invoked.  This property is read-only and available at run-time only.

Data Type

Integer


See Also

Properties:

Action

MailslotSize

NextPriority


Priority Property

See Also

Description

Priority of the next message sent, or the previous message read.

Usage

[form.][control.]Priority[ = integer ]

Remarks

Contains the message priority (0 through 9).  High-priority messages are generally placed ahead of previously stored messages that have lower priority.

This property is available at run-time only.

Data Type

Integer (0-9)


See Also

Properties:

Action

NextPriority


Timeout Property

See Also

Description

Sets the maximum amount of time to wait for a message to be written or read.

Usage

[form.][control.]Timeout[ = integer ]

Remarks

This property specifies how many milliseconds to wait if a message is not immediately available for a Read Action, or how many milliseconds to wait on a Write Action if the mailslot is full.

If this value is set to zero, Read and Write actions dont wait.  If this is set to -1, an action will wait indefinitely.

Data Type

Integer


See Also

Properties:

Action


UserName Property

See Also

Description

Returns the name of the user.

Usage

[form.][control.]UserName[ = username ]

Remarks

This property holds the name of the user.  This property is read-only.

Data Type

String


See Also

Properties:

ComputerName

WorkgroupName


WorkgroupName Property

See Also

Description

Returns the name of the current workgroup.

Usage

[form.][control.]WorkgroupName[ = workgroupname ]

Remarks

This property holds the name of the workgroup the computer is in.  This property is read-only.

Data Type

String


See Also

Properties:

ComputerName

UserName


MessageWaiting Event

See Also

Description

Fires when there are messages pending in the mailslot.

Syntax

Sub ctlname_MessageWaiting (MessageCount As Integer)

Remarks

This event fires when there are messages waiting in the mailslot.  This event can be disabled by setting Interval to zero.


See Also

Properties:

Action

Interval


Registration Information

Credits

MSlot was written by Zane Thomas and James Shields.  Zane can be reached on CompuServe at 72060,3327 or on Internet at 72060.3327@compuserve.com.  His mailing address is:

Zane Thomas

Post Office Box 300

Indianola, WA  98342

Inquiries, tech support, comments should be sent to James Shields at Mabry Software.  Our address is 71231,2066 on CompuServe, or mabry@halcyon.com on Internet.  Our mailing address is:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Registration

You can register this program by sending $30 ($35 for international orders) and your address.  You can register MSlot and its C source code by sending $50 ($55 for international orders).  With your order, you will receive a copy of our manual documenting all of our controls.

For your convenience, an order form has been provided that you can print out directly from this help file.

E-mail Discount

You may take a $5 discount for e-mail delivery of this package (CompuServe or Internet).  If you choose this option, please note: a printed manual is not included.  Be sure to include your full mailing address with your order.  Sometimes (on the Internet) the package cannot be e-mailed.  So, we are forced to send it through the normal mails.

CompuServe members may also take the $5 e-mail discount by registering this package in the software registration forum (GO SWREG).  MSlots SWREG ID number is 1848.  The source code version's ID number is 1849.

Credit Card Orders

We accept VISA and Mastercard.  If you e-mail your order to us, please be sure to include your card number, expiration date, complete mailing address, and your phone number (in case we have any questions about your order).

© Copyright 1994-1995 by Zane Thomas and Mabry Software, Inc.


Order Form
 MSlot Order Form

Use the Print Topic.. command from the File menu to print this order form.

Mail this	Mabry Software, Inc.

form to:	Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com

Where did you get this copy of MSlot?

____________________________________________________________________

Ship to:	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone:	_________________________________________________________________

Fax:	_________________________________________________________________

E-Mail:	_________________________________________________________________

MC/VISA:	_________________________________________ exp. ___________________

Disk Size:	(circle one)	 3½	5¼

qty ordered	____	REGISTRATION

$30 each, postpaid (check or money order in hard currency). Outside of North America add $5.00 shipping.

qty ordered	____	SOURCE CODE AND REGISTRATION

$50 each, postpaid (check or money order in hard currency). Outside of North America add $5.00 shipping.


Getting Custom Controls Written

If you or your organization would like to have custom controls written, you can contact me at the following:

James Shields

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com

You can also contact Zane Thomas.  He can be reached at:

Zane Thomas

Post Office Box 300

Indianola, WA  98342

CompuServe: 72060,3327